package com.yykj.drup.server.service.feign;

import com.yykj.drup.server.service.feign.fallback.MessageCenterServerFeignFallBack;
import com.yykj.message.center.client.dto.DrugOrderMessageBodyDTO;
import com.yykj.message.center.client.dto.TDMQMessageSendResult;
import com.yykj.message.center.client.dto.pay.DrugOrderCancelMessageBodyDTO;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @Author zeng
 * @Date 2022/3/24
 */
@FeignClient(name = "message-center-server", fallbackFactory = MessageCenterServerFeignFallBack.class)
public interface MessageCenterServerFeign {

    /**
     * 发送处方药品下单消息
     * @param messageBodyDTO
     * @return
     */
    @ApiModelProperty("发送处方药品下单消息")
    @PostMapping("/api/tdmq/message/drug/order/created")
    TDMQMessageSendResult sendDrugOrderMessage(@RequestBody DrugOrderMessageBodyDTO messageBodyDTO);

    /**
     * 送延迟取消订单消息
     * @param messageBodyDTO
     * @return
     */
    @ApiModelProperty("发送延迟取消订单消息")
    @PostMapping("/api/tdmq/message/drug/order/cancelDrugOrder")
    TDMQMessageSendResult sendCancelDrugOrderMessage(@RequestBody DrugOrderCancelMessageBodyDTO messageBodyDTO);
}
